<%-- 
    Document   : theater
    Created on : Apr 19, 2012, 12:03:54 AM
    Author     : prateekpatil
--%>
<%@page import="java.sql.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table align="center">
            <thead>
                <tr>
                    <th><h1>CS 425 Project </h1></th>
                </tr>
            </thead>
        </table>
        <form action="newDiscussionServlet" method=post>
               <table cellpadding=4 cellspacing=2 border=0 align="center" width="400" >
                <th bgcolor="#efefef" colspan=2>
                <font size=5>Create New Discussion </font>
                <br><font size=1><sup></sup></font><hr>
                </th>
                <tr bgcolor="#efefef"><td align=center colspan=2 valign=top>
                        <b>Discussion Title<sup>*</sup></b> 
                 <br><input type="text" name="title" value="" size=30 maxlength=50></td>
                </tr>
                <tr bgcolor="#efefef"><td align=center colspan=2 valign=top> 
                        <b>Related to 'Movie'</b> 
                        <select name='movieselect' id="movieselect">
                            <option value="none">Select</option>  
                        <%
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();  
                    Connection con1 = DriverManager.getConnection("jdbc:oracle:thin:@fourier.cs.iit.edu:1521:orcl","rjairaj","cs425dbo");  
                    Statement stmt1= con1.createStatement();  
                    ResultSet rs1 = stmt1.executeQuery("select name from movie");
                    while(rs1.next()){
                        %>
                        <option value="<%=rs1.getString(1)%>"><%=rs1.getString(1)%></option>  
                        <%
                    }
                        %>
                
                    
                </td>
                </tr>
                <tr bgcolor="#efefef"><td align=center colspan=2 valign=top> 
                        </select>
                        <b>Related to 'Theater'</b> 
                        <select name='theaterselect' id="theaterselect">
                            <option value="none">Select</option>  
                        <%
                        ResultSet rs2 = stmt1.executeQuery("select theater_name from theater");
                    while(rs2.next()){
                        %>
                        <option value="<%=rs2.getString(1)%>"><%=rs2.getString(1)%></option>  
                        <%
                    }
                        %>
                        </select>
                    </td>
                </tr>
                <tr bgcolor="#efefef"><td align=center colspan=2 valign=top>
                        <b>Content<sup>*</sup></b> 
                 <br><input type="textarea" name="content" value="" size="100" maxlength=2000></td>
                </tr>
                <tr bgcolor="#efefef">
                <td align=center colspan=2><hr>
                <input type="submit" value="Submit"></td></tr></table></center>
        </form>
    </body>
</html>
 